package com.java.onlineshop.service.impl;

import com.java.onlineshop.dao.IProductDao;
import com.java.onlineshop.impl.ProductDaoImpl;
import com.java.onlineshop.pojo.Product;
import com.java.onlineshop.service.IProductService;

import java.util.List;

/**
 * @program: onlineshop
 * @description: 商品服务实现类
 * @author: ShuangChenYue
 * @create: 2021-06-05 13:52
 **/
public class ProductServiceImpl implements IProductService
{

    IProductDao productDao = new ProductDaoImpl();

    @Override
    public List<Product> findAllProduct()
    {
        return productDao.findAllProduct();
    }

    @Override
    public Product findProductById(int id)
    {
        return productDao.findProductById(id);
    }

    @Override
    public List<Product> findProductByLikeName(String name)
    {
        return productDao.findProductByLikeName(name);
    }

    @Override
    public List<Product> findProductByCategoryId(int id)
    {
        return productDao.findProductByCategoryId(id);
    }
}
